package com.atguigu.gmall.order.client;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.order.OrderInfo;
import com.atguigu.gmall.order.client.impl.OrderFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Map;

/**
 * @author : zjj
 * @date : 2021/2/5 16:01
 */

@FeignClient(name="service-order",fallback = OrderFeignFallback.class)
public interface OrderFeignClient {

    /**
     * 远程调用接口
     *
     * @return 结果
     */

    @GetMapping("/api/order/auth/trade")
    Result<Map<String,Object>> trade();

    /**
     * 根据订单id，查询订单信息
     * @param orderId   订单id
     * @return          订单信息
     */
    @GetMapping("/api/order/inner/getOrderInfo/{orderId}")
    OrderInfo getOrderInfo(@PathVariable Long orderId);
}
